﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BI.CF.Model;
using BI.CF.BLL;
using BI.CF.DAL;
using BI.CF.PageList;

namespace BackStage.Hand
{
    /// <summary>
    /// RechargeRecord 的摘要说明
    /// </summary>
    public class RechargeRecord : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            MyaccountBLL bll = new MyaccountBLL();
            decimal MinMoney = 0;
            decimal MaxMoney = 0;
            int index = Convert.ToInt32(context.Request["Index"]);
            int size = Convert.ToInt32(context.Request["Size"]);
            DateTime MinTime=Convert.ToDateTime("1997-01-01");
            DateTime MaxTime=Convert.ToDateTime("2017-02-28");
            if (context.Request["MinTime"] != null && context.Request["MinTime"].ToString()!="")
	        {
                MinTime = Convert.ToDateTime(context.Request["MinTime"]);
	        }
            if (context.Request["MaxTime"] != null && context.Request["MaxTime"].ToString() != "")
            {
                MaxTime = Convert.ToDateTime(context.Request["MaxTime"]);
            }
            if (context.Request["MinMoney"] != null)
            {
                MinMoney =Convert.ToDecimal(context.Request["MinMoney"]);
            }
            if (context.Request["MaxMoney"] != null)
            {
                MaxMoney = Convert.ToDecimal(context.Request["MaxMoney"]);
            }


            Pager<RechargeRecordModel> list = bll.ShowRechargeRecord(MinMoney, MaxMoney, MinTime, MaxTime, "线上", 0, index, size);
            string str = JsonHelper.JsonSerializer<Pager<RechargeRecordModel>>(list);
            context.Response.Write(str);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}